home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 5 / MacMania 5.toast / / Internet software / Analog 2.0 / Analog 2.0 Src / analhead.h < prev    next >
Text File  |  1997-02-12  |  14KB  |  369 lines

  1. /*** analhead.h: header file for analog 2.0 ***/
  2. /* Please read Readme.html, or http://www.statslab.cam.ac.uk/~sret1/analog/  */
  3.  
  4. /*** Change any of these according to your desires ***/
  5.  
  6. #ifndef ANALHEAD
  7. #define ANALHEAD
  8.  
  9. /*** The first few options -- up to LOGOURL -- are ones that you may want to
  10.      change before compiling the program for the first time. ***/
  11.  
  12. #define HOSTNAME "the Statistical Laboratory"
  13. /* the name of your organisation or WWW host. This is used for printing
  14.    at the top of the output */
  15.  
  16. #define HOSTURL "http://www.statslab.cam.ac.uk/"
  17. /* the URL of your host's home page, for linking to at the top of the
  18.    output; use "-" for no linking. */
  19.  
  20. #define DOMAINSFILE "domains.tab"
  21. /* the name of the file where the domain definitions live; see README.html
  22.    for the format of this file */
  23.  
  24. #define LOGFILE "WebSTAR.log"
  25. /* The name of the default logfile; use "stdin" for stdin.
  26.    Can be a list, separated by commas (but no spaces). */
  27.  
  28. #define IMAGEDIR "./images/"
  29. /* URL of the directory where the images for the graphical reports live.
  30.    The URL can be absolute, or relative to the output page: e.g., just the
  31.    empty string "" for the same directory as the output page. */
  32.  
  33. #define DEFAULTCONFIGFILE "analog.cfg"
  34. /* the name of the default configuration file; see README.html for a
  35.    description of this file. Use "none" for no configuration file. */
  36.  
  37. #define MANDATORYCONFIGFILE "manconf.cfg"
  38. /* A mandatory configuration file; read after all other arguments so
  39.    overrides everything. Program exits if it is not found. Use "none"
  40.    for none. */
  41.  
  42. #define LOGOURL "./images/analogo.gif"
  43. /* the URL of the file where the analog logo lives. (One should have come
  44.    with the program). You can put another logo in here (your organisation's
  45.    logo, for example). Use "none" for no logo */
  46.  
  47. /*** The next few options are compiled into the program. They can't be
  48.      changed without re-compiling the program. ***/
  49.  
  50. #define MAX_CONFIGS (50)
  51. /* The maximum number of configuration files that are allowed. */
  52.  
  53. #define MINPAGEWIDTH (25)
  54. #define MAXPAGEWIDTH (240)
  55. /* the min and max allowed values of the pagewidth variable */
  56.  
  57. #define MINGRAPHWIDTH (15)
  58. /* bar charts must be at least this many characters wide */
  59.  
  60. #define FORMPROG "/cgi-bin/analform.cgi"
  61. /* If you make an analog form interface, what will be the URL of the
  62.    program that processes it? (It should be wherever cgi-bin programs
  63.    go on your server; normally in a cgi-bin directory). */
  64.  
  65. #define MAXLINELENGTH (2048)
  66. /* the maximum length of any line in the logfile (long lines can
  67.    result from searches), domains file or rc file. Longer lines
  68.    will be thrown away. */
  69.  
  70. #define MAXSTRINGLENGTH (256)
  71. /* how long is the longest string we want for a list of filenames, our
  72.    organisation name, an internet address, a geographical location,
  73.    an argument to a configuration command etc.?
  74.    (Longer strings will be truncated). MUST BE AT LEAST 256. */
  75.  
  76. /*** The rest of the options can be overridden when the program is run. ***/
  77.  
  78. #define OUTFILE "Report.html"
  79. /* the default file for output. Use "stdout" for stdout. */
  80.  
  81. #define CACHEFILE "none"
  82. /* The default file of cached time info. Use "none" for none. */
  83.  
  84. #define REFERRER_LOG "none"
  85. /* The name of the default referrer log (= referer_log). Use "none" for none.
  86.    Can be a list, separated by commas. */
  87.  
  88. #define BROWSER_LOG "none"
  89. /* The name of the default browser log (= agent_log) similarly. */
  90.  
  91. #define ERROR_LOG "none"
  92. /* The name of the default error_log similarly. */
  93.  
  94. #define NUMLOOKUP (OFF)
  95. /* whether to try and resolve IP addresses. Can be slow. */
  96.  
  97. #define DNSFILE "dnscache"
  98. /* where to store resolved addresses so we don't have to look them up next
  99.    time */
  100.  
  101. #define DNSFRESHHOURS (168)
  102. /* How many hours the information stays fresh for before we have to look it
  103.    up again. */
  104.  
  105. #define DIRSUFFIX "index.html"
  106. /* the default filename tried if a directory is requested. The program
  107.    combines statistics from /dir/ and /dir/DIRSUFFIX. If you don't wish
  108.    this combining to occur, define DIRSUFFIX to be "". The usual value
  109.    is "index.html". (It would be nice to allow index.html or home.html,
  110.    say, but this is not possible to do accurately without knowing more
  111.    information than is in the logfile). */
  112.  
  113. #define REQHASHSIZE (1009)
  114. /* the size of the hash table for requests; must be odd, should be prime.
  115.    too small will make the program slower; too big might use a bit
  116.    more memory and be slightly less efficient. Maybe half the number
  117.    of URLs expected, but it shouldn't be at all critical. There is a list
  118.    of primes in the file primes.tab */
  119.  
  120. #define DIRHASHSIZE (97)
  121. /* ditto for directories */
  122.  
  123. #define TYPEHASHSIZE (97)
  124. /* and for filetypes */
  125.  
  126. #define HOSTHASHSIZE (3079)
  127. /* ditto for all hostnames that have accessed us */
  128.  
  129. #define SUBDOMHASHSIZE (503)
  130. /* and again for all subdomains we want to analyse */
  131.  
  132. #define REFHASHSIZE (659)
  133. /* and again for all URLs that have referenced our site */
  134.  
  135. #define BROWHASHSIZE (97)
  136. /* and for all makes of browser */
  137.  
  138. #define FULLBROWHASHSIZE (659)
  139. /* and for all browsers, distinguishing different versions etc. */
  140.  
  141. #define DNSHASHSIZE (3079)
  142. /* and for numerical addresses in the DNS cache */
  143.  
  144. #ifdef UNIX
  145. #define CASE (SENSITIVE)
  146. #else
  147. #define CASE (INSENSITIVE)
  148. #endif
  149. /* Do you have a case sensitive or case insensitive file system? */
  150.  
  151. #define REPORTORDER "mWdDhHoSitrfbBce"
  152. /* A string like "mWdDhHoSitrfbBce" giving the order in which the reports will
  153.    be output. You should make sure to include each of the above letters exactly
  154.    once or you will not get some report even if you specifically request it
  155.    later, or you may get some report twice. The letters mean
  156.    m = monthly report   W = weekly report    d = daily summary
  157.    D = daily report     h = hourly summary   H = hourly report
  158.    o = domain report    S = host report      i = directory report
  159.    r = request report   f = referrer report  b = browser summary
  160.    B = browser report   e = error report     c = status code report
  161.    t = filetype report */
  162.  
  163. /* whether we want each of the reports by default */
  164. #define GENERAL (ON)      /* General statistics and GoTo's */
  165. #define MONTHLY (ON)      /* Monthly report */
  166. #define DAILY (ON)        /* Daily summary */
  167. #define FULLDAILY (OFF)   /* Daily report */
  168. /* One line for each day. Think about the poor people loading your page from
  169.    the other side of the world before turning this on by default. */
  170. #define WEEKLY (OFF)      /* Weekly report */
  171. #define HOURLY (ON)       /* Hourly summary */
  172. #define FULLHOURLY (OFF)  /* Hourly report */
  173. /* One line for each hour ever. You really don't want this on by default. */
  174. #define DOMAINREP (ON)    /* Domain report */
  175. /* Not called DOMAIN because clashes with math.h */
  176. #define DIRECTORY (ON)    /* Directory report */
  177. #define FILETYPE (OFF)    /* File type report */
  178. #define REQUEST (ON)      /* Request report */
  179. #define FULLHOSTS (OFF)   /* Host report */
  180. /* Full hostname report. Typically very long output and slow to produce
  181.    on a full logfile, unless MIN_HOST_REQS or _BYTES is high as applicable */
  182. #define REFERRER (OFF)    /* Referrer report */
  183. #define BROWSER (OFF)     /* Browser summary */
  184. #define FULLBROWSER (OFF) /* Browser report */
  185. #define STATUS (OFF)      /* Status code report */
  186. #define ERROR (OFF)       /* Error report */
  187.  
  188. #define DOMCOLS "Rb"
  189. /* Which columns we want to appear in the domain report, and in which order.
  190.    The string can contain any of the following four letters:
  191.    R   Number of requests from each domain
  192.    r   Percentage of the requests from each domain
  193.    P   Number of requests for pages from each domain
  194.    p   Percentage of the requests for pages from each domain
  195.    B   Total number of bytes transferred to each domain
  196.    b   The percentage of traffic to each domain */
  197. /* And the same for the other reports */
  198. #define HOSTCOLS "Rb"
  199. #define DIRCOLS "Rb"
  200. #define TYPECOLS "Rb"
  201. #define REQCOLS "Rb"
  202. #define MONTHCOLS "P"
  203. #define DAYCOLS "P"
  204. #define FULLDAYCOLS "P"
  205. #define WEEKCOLS "P"
  206. #define HOURCOLS "P"
  207. #define FULLHOURCOLS "P"
  208. #define REFCOLS "R"
  209. #define BROWCOLS "R"
  210. #define FULLBROWCOLS "R"
  211.  
  212. /* Should the time graphs be calculated by requests 'R', bytes 'B' or
  213.    pages 'P'? */
  214. #define MONTHGRAPH 'P'
  215. #define DAYGRAPH 'P'
  216. #define FULLDAYGRAPH 'P'
  217. #define HOURGRAPH 'P'
  218. #define FULLHOURGRAPH 'P'
  219. #define WEEKGRAPH 'P'
  220.  
  221. /* Should they go forwards (oldest entries at top) or backwards?
  222.    (NB You can mix them, but probably don't want to) */
  223. #define MONTHLYBACK (FALSE)
  224. #define FULLDAILYBACK (FALSE)
  225. #define FULLHOURLYBACK (FALSE)
  226. #define WEEKLYBACK (FALSE)
  227.  
  228. /* The maximum number of rows in each (0 for "show all time") */
  229. #define MONTHROWS (0)
  230. #define WEEKROWS (0)
  231. #define FULLDAYROWS (42)
  232. #define FULLHOURROWS (72)
  233.  
  234. #define GRAPHICAL (ON)
  235. /* whether the graphs should use proper graphics or just ASCII art. ON will
  236.    make it prettier but will make the output longer and harder to download */
  237.  
  238. #define MIN_URL_REQS "20"
  239. /* the min. no. of requests a URL should have before appearing on the
  240.    request report. Setting this to about 20 clears out a lot of junk.
  241.    You can also use e.g. "0.1%" for any file with 0.1% of the requests.
  242.    And setting it to a negative number gives a "top n" report. */
  243.  
  244. #define MIN_URL_BYTES "0.01%"
  245. /* if we are sorting by bytes, use this instead. You can use
  246.    "1000234" for 1000234 bytes
  247.    "100k"    for 100 kilobytes  (and 100M etc. similarly)
  248.    "0.01%"   for any file with 0.01% of the bytes
  249.    "-50"     for the 50 files with the most bytes  */
  250.  
  251. /* now the same for directory, domain and hostname reports under requests,
  252.    page requests, or bytes sorting. */
  253. #define MIN_DIR_REQS "10"
  254. #define MIN_DIR_PAGES "10"
  255. #define MIN_DIR_BYTES "0.01%"
  256. #define MIN_TYPE_REQS "100"
  257. #define MIN_TYPE_PAGES "100"
  258. #define MIN_TYPE_BYTES "0.1%"
  259. #define MIN_DOM_REQS "1"
  260. #define MIN_DOM_PAGES "1"
  261. #define MIN_DOM_BYTES "0"
  262. #define MIN_HOST_REQS "-100"
  263. #define MIN_HOST_PAGES "-100"
  264. #define MIN_HOST_BYTES "-100"
  265. #define MIN_REF_REQS "20"
  266. #define MIN_REF_PAGES "20"
  267. #define MIN_REF_BYTES "0.01%"
  268. #define MIN_BROW_REQS "-20"
  269. #define MIN_BROW_PAGES "-20"
  270. #define MIN_BROW_BYTES "-20"
  271. #define MIN_FULLBROW_REQS "-100"
  272. #define MIN_FULLBROW_PAGES "-100"
  273. #define MIN_FULLBROW_BYTES "-100"
  274. /* And the same for subdomains you have specified. These can't be negative. */
  275. #define MIN_SUBDOM_REQS "1000"
  276. #define MIN_SUBDOM_PAGES "300"
  277. #define MIN_SUBDOM_BYTES "0.5%"
  278. /* And the min number of occurences before an error gets on the error report */
  279. #define MIN_ERR_OCCS (1)
  280.  
  281. /* how should the various reports be sorted? Legal values ar BYREQUESTS,
  282.    BYPAGES, BYBYTES and ALPHABETICAL */
  283. #define REQSORTBY (BYREQUESTS)
  284. #define DOMSORTBY (BYBYTES)
  285. #define DIRSORTBY (BYBYTES)
  286. #define TYPESORTBY (BYBYTES)
  287. #define HOSTSORTBY (ALPHABETICAL)
  288. #define REFSORTBY (BYREQUESTS)
  289. #define BROWSORTBY (BYREQUESTS)
  290. #define FULLBROWSORTBY (BYREQUESTS)
  291.  
  292. #define WEEKBEGINSON (SUNDAY)
  293. /* The 1st day of the week. I think it's SUNDAY, but you can choose any day. */
  294.  
  295. #define SEPCHAR ','
  296. /* The character to separate the thousands in a long number. I prefer ' ',
  297.    but some people prefer '.' or ','. Use '\0' for no separator. Use '9' if
  298.    you really want to inflate your statistics! :) */
  299.  
  300. #define REPSEPCHAR '\0'
  301. /* The same for long numbers within the detailed output */
  302.  
  303. #define DECPOINT '.'
  304. /* Character to use as the decimal point. */
  305.  
  306. #define PRESEP "\t"
  307. /* A separator string between fields in preformatted output */
  308.  
  309. #define APPROXHOSTSIZE (500000)
  310. /* The number of bytes to allocate for approximate hostname counting;
  311.    more will make it more accurate. About 3 bytes per host should give
  312.    you a very good estimate, though even 1 byte per host will be fair.
  313.    If statistics for last 7 days are asked for, twice this amount of space
  314.    will be used. */
  315.  
  316. #define BASEURL "none"
  317. /* A string which is prepended to all URLs linked to in the request report.
  318.    This is useful if you want to display the statistics on a different
  319.    server from the one that generated the logfile. Use "none" for none. */
  320.  
  321. #define RAWBYTES (OFF)
  322. /* whether bytes should be quoted in full (e.g., 1 021 453) as opposed to
  323.    in kilobytes, megabytes etc. (e.g., 998k). */
  324.  
  325. #define HEADERFILE "none"
  326. /* an extra file (with HTML markup if desired) placed between the page title
  327.    and the start of the statistics. Use "none" for none. */
  328.  
  329. #define FOOTERFILE "none"
  330. /* And one placed at the bottom of the page */
  331.  
  332. #define OUTPUT (HTML)
  333. /* Default output type: ASCII, HTML or CACHE */
  334.  
  335. #define LANGUAGE (ENGLISH)
  336. /* Default language for the output page:
  337.    ENGLISH, US_ENGLISH, FRENCH, GERMAN, ITALIAN, SPANISH, DANISH */
  338.  
  339. #define DEBUG (0)
  340. /* Level of debugging output: 0 = none, 1 = print all corrupt lines to stderr,
  341.    2 = also print hosts with unknown domains. */
  342.  
  343. #define PROGRESSFREQ (5000)
  344. /* Frequency of progress reports. 0 for no reports. */
  345.  
  346. #define MARKCHAR '+'
  347. /* a character for the graphical displays */
  348.  
  349. #define PAGEWIDTH (65)
  350. /* the width of the output. Standard text screens have 80 columns, but for
  351.    WWW browsers something like 65 is probably better. */
  352.  
  353. #define DIRLEVEL (1)
  354. /* the level of directory report; see README */
  355.  
  356. #define COUNTHOSTS (ON)
  357. /* whether we want to count the number of distinct hosts
  358.    Can be ON, OFF or APPROX (for approximate count; in fact lower bound)
  359.    FULLHOSTS ON turns COUNTHOSTS ON
  360.    Turning this to OFF or APPROX will save a lot of memory */
  361.  
  362. #define LASTSEVEN (ON)
  363. /* whether we want statistics for the last seven days */
  364.  
  365. #define WARNINGS (ON)
  366. /* whether we want to see warnings */
  367.  
  368. #endif
  369.